/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package Telas;

import SYSGEST.br.Entrada.Entrada;
import SYSGEST.br.Entrada.EntradaDAO;
import SYSGEST.br.Entrada.EntradaModel;
import SYSGEST.br.Funcionario.Funcionario;
import SYSGEST.br.Funcionario.FuncionarioDAO;
import SYSGEST.br.Produto.Produtos;
import SYSGEST.br.Produto.ProdutosDAO;
import SYSGEST.conexao.Ativo;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.swing.JOptionPane;

/**
 *
 * @author Mesopotanea
 */
public class TelaEntrada extends javax.swing.JDialog {

    Produtos produtos;
    Entrada EntradaProduto;
    Produtos pesquisarProduto = new Produtos();
    Funcionario pesquisarFuncionario = new Funcionario();
    private List<Entrada> entradas = new ArrayList<>();

    /**
     * Creates new form TelaEntradas
     */
    public TelaEntrada() {
        initComponents();
        setLocationRelativeTo(null);
      
        setModal(true);

        SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
        try {
            //Date data = new Date();
            edtDtEntrada.setText(sdf.format(new Date()));

        } catch (Exception e) {
        }
        EntradaDAO DAO = new EntradaDAO();
        EntradaModel ltm = new EntradaModel(entradas);
        tbPedidoEntrada.setModel(ltm);
    }

    public TelaEntrada(Produtos produtos) {
        this.produtos = produtos;
        edtCodEntrada.setText(produtos.getProduto());
        edtCodProEntrada.setText(produtos.getCodBarras());

    }
     public TelaEntrada(String login) {
      initComponents();
        setLocationRelativeTo(null);
       
        setModal(true);   
        edtFuncionario.setText(login.toUpperCase());
        SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
        try {
            //Date data = new Date();
            edtDtEntrada.setText(sdf.format(new Date()));

        } catch (Exception e) {
        }
        EntradaDAO DAO = new EntradaDAO();
        EntradaModel ltm = new EntradaModel(entradas);
        tbPedidoEntrada.setModel(ltm);
         
     }

    public TelaEntrada(Entrada entradas) {
        initComponents();
        setLocationRelativeTo(null);

        this.EntradaProduto = entradas;
        SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
        try {

            edtDtEntrada.setText(sdf.format(new Date()));
        } catch (Exception e) {
        }

        atualizaTabela();

    }



    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane1 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();
        jPanel1 = new javax.swing.JPanel();
        jLabel3 = new javax.swing.JLabel();
        edtCodEntrada = new javax.swing.JFormattedTextField();
        edtCodProEntrada = new javax.swing.JTextField();
        jLabel1 = new javax.swing.JLabel();
        btPesquisar = new javax.swing.JButton();
        jLabel4 = new javax.swing.JLabel();
        edtDtEntrada = new javax.swing.JFormattedTextField();
        jLabel8 = new javax.swing.JLabel();
        edtQuant = new javax.swing.JTextField();
        btIncluir = new javax.swing.JButton();
        jScrollPane2 = new javax.swing.JScrollPane();
        tbPedidoEntrada = new javax.swing.JTable();
        btGravar = new javax.swing.JButton();
        btExcluir = new javax.swing.JButton();
        jLabel7 = new javax.swing.JLabel();
        edtFuncionario = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();

        jTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jScrollPane1.setViewportView(jTable1);

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Entrada de Mercadoria");
        setResizable(false);

        jLabel3.setFont(new java.awt.Font("Verdana", 1, 13)); // NOI18N
        jLabel3.setText("Cod. Barras.:");

        try {
            edtCodEntrada.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("#############")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        edtCodEntrada.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                edtCodEntradaFocusLost(evt);
            }
        });
        edtCodEntrada.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                edtCodEntradaActionPerformed(evt);
            }
        });

        jLabel1.setFont(new java.awt.Font("Verdana", 1, 13)); // NOI18N
        jLabel1.setText("Produto.:");

        btPesquisar.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        btPesquisar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/SYSGEST/br/imagens/pesquisar.png"))); // NOI18N
        btPesquisar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btPesquisarActionPerformed(evt);
            }
        });

        jLabel4.setFont(new java.awt.Font("Verdana", 1, 13)); // NOI18N
        jLabel4.setText("Data Entrada.:");

        edtDtEntrada.setEditable(false);
        edtDtEntrada.setBackground(new java.awt.Color(255, 204, 102));
        edtDtEntrada.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
        edtDtEntrada.setForeground(new java.awt.Color(102, 102, 102));
        try {
            edtDtEntrada.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##/##/####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        edtDtEntrada.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        edtDtEntrada.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N

        jLabel8.setFont(new java.awt.Font("Verdana", 1, 13)); // NOI18N
        jLabel8.setText("Quantidade.:");

        btIncluir.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        btIncluir.setIcon(new javax.swing.ImageIcon(getClass().getResource("/SYSGEST/br/imagens/Incluir.png"))); // NOI18N
        btIncluir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btIncluirActionPerformed(evt);
            }
        });

        tbPedidoEntrada.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3"
            }
        ));
        jScrollPane2.setViewportView(tbPedidoEntrada);

        btGravar.setFont(new java.awt.Font("Arial Black", 1, 13)); // NOI18N
        btGravar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/SYSGEST/br/imagens/SALVAR.png"))); // NOI18N
        btGravar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btGravarActionPerformed(evt);
            }
        });

        btExcluir.setFont(new java.awt.Font("Arial Black", 1, 13)); // NOI18N
        btExcluir.setIcon(new javax.swing.ImageIcon(getClass().getResource("/SYSGEST/br/imagens/excluir.png"))); // NOI18N
        btExcluir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btExcluirActionPerformed(evt);
            }
        });

        jLabel7.setFont(new java.awt.Font("Verdana", 1, 13)); // NOI18N
        jLabel7.setText("Funcionário.:");

        edtFuncionario.setEditable(false);
        edtFuncionario.setEnabled(false);
        edtFuncionario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                edtFuncionarioActionPerformed(evt);
            }
        });

        jLabel5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/SYSGEST/br/imagens/entrada de mercadoria.png"))); // NOI18N

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 102, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel8))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(edtQuant, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jLabel7)
                                .addGap(15, 15, 15)
                                .addComponent(edtFuncionario, javax.swing.GroupLayout.PREFERRED_SIZE, 239, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(0, 0, Short.MAX_VALUE))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(edtCodEntrada, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(10, 10, 10)
                                .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(edtCodProEntrada, javax.swing.GroupLayout.PREFERRED_SIZE, 239, javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel4)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGap(109, 109, 109)
                                .addComponent(edtDtEntrada, javax.swing.GroupLayout.PREFERRED_SIZE, 108, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(btIncluir, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btExcluir, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btPesquisar, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addGap(0, 0, Short.MAX_VALUE)
                .addComponent(btGravar, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(305, 305, 305))
            .addComponent(jLabel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addComponent(jScrollPane2)
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(1, 1, 1)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel1)
                                .addComponent(jLabel3)
                                .addComponent(edtCodEntrada, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(edtCodProEntrada, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(btPesquisar, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(edtQuant, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel7)
                            .addComponent(edtFuncionario, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addComponent(jLabel8))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btIncluir, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel4)
                        .addComponent(edtDtEntrada, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(btExcluir, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 116, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btGravar, javax.swing.GroupLayout.PREFERRED_SIZE, 40, Short.MAX_VALUE)
                .addContainerGap())
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void edtCodEntradaFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_edtCodEntradaFocusLost
        // TODO add your handling code here:

        // metodo pesquisa codigo de produto
        if (!edtCodEntrada.getText().toString().replaceAll("\\D*", "").isEmpty()) {
            ProdutosDAO ent = new ProdutosDAO();
            pesquisarProduto = ent.pesquisaESF(edtCodEntrada.getText());
            edtCodProEntrada.setText(pesquisarProduto.getProduto());
            edtCodEntrada.setText(pesquisarProduto.getCodBarras());

        }

    }//GEN-LAST:event_edtCodEntradaFocusLost

    private void edtCodEntradaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_edtCodEntradaActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_edtCodEntradaActionPerformed

    private void btPesquisarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btPesquisarActionPerformed
        // BOTAO PESQUISAR PRODUTOS
        pesquisarProduto = TelaBuscaEntradaProduto.chamaTela();
        if (pesquisarProduto != null) {
            edtCodProEntrada.setText(pesquisarProduto.getProduto());
            edtCodEntrada.setText(pesquisarProduto.getCodBarras());

        }
    }//GEN-LAST:event_btPesquisarActionPerformed

    private void btExcluirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btExcluirActionPerformed
        // BOTAO EXCLUIR

        int linha = tbPedidoEntrada.getSelectedRow();
        if (linha == -1) {
            JOptionPane.showMessageDialog(rootPane,
                    "Selecione uma linha a ser excluída!");
        } else {
            if (JOptionPane.showConfirmDialog(rootPane,
                    "Deseja excluir o item selecionado?",
                    "Excluir?", JOptionPane.YES_NO_OPTION)
                    == JOptionPane.YES_OPTION) {

                EntradaDAO dao = new EntradaDAO();
                int codigo = (int) tbPedidoEntrada.getValueAt(linha, 0);

                Entrada entradaProduto = dao.pesquisacodigo(codigo);

                for (int i = 0; i < entradas.size(); i++) {
                    if (entradas.get(i).getProdu().getProduto().equals(entradaProduto.getProdu().getProduto())) {
                        entradas.remove(i);

                    }
                }

                EntradaModel sm = new EntradaModel(entradas);
                tbPedidoEntrada.setModel(sm);

            }

        }
    }//GEN-LAST:event_btExcluirActionPerformed

    private void btIncluirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btIncluirActionPerformed
        // BOTAO INCLUIR

        if (!edtCodProEntrada.getText().equals("")) {
            if (pesquisarProduto != null && pesquisarFuncionario != null) {
                if (!edtQuant.getText().equals("")) {
                    int qtd = Integer.parseInt(edtQuant.getText());

                    if (qtd > 0) {
                        Entrada e = new Entrada();
                        e.setProd(pesquisarProduto);
                        e.setFuncionario(edtFuncionario.getText().toUpperCase());
                        e.setQtdEntrada(Integer.parseInt(edtQuant.getText()));

                        try {
                            if (!edtDtEntrada.getText().replaceAll("/", "").isEmpty()) {
                                DateFormat fmt = new SimpleDateFormat("dd/MM/yyyy");
                                java.util.Date data;
                                data = new java.util.Date(fmt.parse(edtDtEntrada.getText()).getTime());
                                e.setdEntrada(data);
                            }
                        } catch (ParseException ex) {
                            System.out.println(ex.getMessage());

                        }
                        entradas.add(e);
                        atualizaTabela();
                        pesquisarProduto = null;
                    } else {
                        JOptionPane.showMessageDialog(rootPane, "Quantidade Não pode Ser 0!!");
                    }

                } else {
                    JOptionPane.showMessageDialog(rootPane, "Informe a Quantidade!");
                }

            } else {
                JOptionPane.showMessageDialog(rootPane, "Selecione um produto");
            }
        } else {
            JOptionPane.showMessageDialog(rootPane, "Campos Obrigatórios");
        }
    }

    public void atualizaTabela() {
        EntradaModel sm = new EntradaModel(entradas);
        tbPedidoEntrada.setModel(sm);
        edtCodEntrada.setText("");
        edtCodProEntrada.setText("");
        edtQuant.setText("");

    }//GEN-LAST:event_btIncluirActionPerformed

    private void btGravarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btGravarActionPerformed
        //BOTAO GRAVAR
       SalvarProduto();

    }//GEN-LAST:event_btGravarActionPerformed

    private void edtFuncionarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_edtFuncionarioActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_edtFuncionarioActionPerformed

    public void SalvarProduto() {
        Entrada entraProd = new Entrada();

        if (entraProd == null) {
            entraProd = new Entrada();
        }

        if (entradas.size() > 0) {
            EntradaDAO dao = new EntradaDAO();

            for (int i = 0; i < entradas.size(); i++) {
                dao.salvar(entradas.get(i));
                ProdutosDAO pDAO = new ProdutosDAO();
                Produtos p = entradas.get(i).getProdu();
                p.setqtdEstoqueatual(p.getqtdEstoqueatual() + entradas.get(i).getQtdEntrada());
                pDAO.alterar(p);

                edtCodProEntrada.setText("");
                edtCodEntrada.setText("");
                edtQuant.setText("");
                edtFuncionario.setText("");
            }
            JOptionPane.showMessageDialog(rootPane, "Entrada de Mercadoria");
            entradas = new ArrayList<Entrada>();

            atualizaTabela();
        } else {
            JOptionPane.showMessageDialog(rootPane, "Nao existe produtos selecionados");
        }

    }

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(TelaEntrada.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(TelaEntrada.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(TelaEntrada.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(TelaEntrada.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new TelaEntrada().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btExcluir;
    private javax.swing.JButton btGravar;
    private javax.swing.JButton btIncluir;
    private javax.swing.JButton btPesquisar;
    private javax.swing.JFormattedTextField edtCodEntrada;
    private javax.swing.JTextField edtCodProEntrada;
    private javax.swing.JFormattedTextField edtDtEntrada;
    private javax.swing.JTextField edtFuncionario;
    private javax.swing.JTextField edtQuant;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JTable jTable1;
    private javax.swing.JTable tbPedidoEntrada;
    // End of variables declaration//GEN-END:variables
}
